<?php
/**
 * 会员相关接口
 */
require_once APP_PATH.'/index/global.php';
class index_util_interface{
	
	
	/**
	 * 用户记录
	 *
	 * @param unknown_type $cartoon_id
	 * @param unknown_type $uid
	 * @param unknown_type $chapter_id
	 */
	public function log($cartoon_id,$uid,$act_type = 1,$chapter_id = 0 ){
		if(is_numeric($cartoon_id) && is_numeric($uid)){
			return Model::factory('index_model_log')->add(array('cartoon_id'=>$cartoon_id,'uid'=>$act_type,'act_type'=>$act_type,'chapter_id'=>$chapter_id));
		}
	}	

	public static function sendMail(){
		$mailer = new PHPMailer();
		$mailer->IsSMTP();
		$mailer->Mailer = "smtp";
		$mailer->Subject = "我不想活了！";
		$mailer->AddAddress("fanzhanao@163.com", "fanzhanao");
		$mailer->From = MAIL_USER;
		$mailer->FromName = "fanzhanao";
		$mailer->Body = "人生如梦世事如迷。。";
		$mailer->Send();
		if($mailer->IsError()){
//			print_r($mailer->ErrorInfo);
			return $mailer->ErrorInfo;
		}else{
			return true;
		}
	}
	
}